<template>
  <div class="wrapper">
    <Header></Header>
    <div style="height: calc(100% - 50px)">
      <Sidebar :items = 'items'></Sidebar>
      <!-- /.sidebar -->
      <div class="content-wrapper">
        <router-view></router-view>
      </div>
    </div>
  </div>

</template>


<script>
  // dataTable样式和js
  import 'datatables.net-bs/css/dataTables.bootstrap.css'
  import 'datatables.net/js/jquery.dataTables'
  import 'datatables.net-bs/js/dataTables.bootstrap'
  // 模块组件
  import Header from '@/components/common/Header';
  import Sidebar from '@/components/common/Sidebar';
  import ListItem from '@/components/common/listItem'

  export default {
    name: "logistics",
    data(){
      return{
        items:[]
      }
    },
    components:{
      Header,
      Sidebar,
      ListItem
    },
    created(){
      this.$fetch('/api/list').then((data) => {   /* 调用vue的ajax来请求数据，promise语法，并用es6的箭头函数 */
        this.items = data.data;
        console.log(this.items)
      })
    }
  }
</script>

<style scoped>

</style>
